package de.g18.it0a.jlaser.dataio;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

import de.g18.it0a.jlaser.domain.RoomConfiguration;
import de.g18.it0a.jlaser.jlf.JLFConverter;


public class RoomConfigurationWriter {


    private RoomConfigurationWriter() {
        // Prevent instantiation
    }

    public static final void write(RoomConfiguration aRoomConfig, String aFileName) throws IOException {
    	write(aRoomConfig, new File(aFileName));
    }

    public static final void write(RoomConfiguration aRoomConfig, File aFile) throws IOException {
        FileWriter fw = null;
        try {
            fw = new FileWriter(aFile);
            fw.write(JLFConverter.valueOf(aRoomConfig));
        } finally {
            if (fw != null) {
                fw.close();
            }
        }
    }
}
